﻿#include "AF_Platform.h"
// #include "AF_ZipPackage.h"

#include <time.h>

namespace AF
{
// 	AF_CPackage* AF_CPlatform::CreateDefaultPackage(_STRING& AF_OUT strExtension)
// 	{
// 		strExtension = "Zip";
// 		return AF_NEW(AF_CZipPackage);
// 	}

	void Platform::ConsoleOut(_STRING strText, bool isEnter)
	{
		_COUT << strText;
		if(isEnter)
			_COUT << _ENDL;
	}

	void Platform::Delay(TimeTicks ttSleep)
	{
		static TimeTicks ttNow;
		static TimeTicks ttCur;

		ttNow = GetTimeTicks();
		do
		{
			ttCur = GetTimeTicks();
		}while(ttCur - ttNow < ttSleep);
	}

	TimeTicks Platform::GetTimeTicks()
	{
		return (TimeTicks)clock();
	}
}